package com.alibaba.citrus.cr.price.common;

import java.util.Arrays;

/**
 * @author qjg
 * 枚举值定义
 */
public enum DimensionPropertyEnum {

    ORG_SALES_ORGANIZATION_CODE("org_sales_organization_code", "销售组织编码","销售组织"),

    CHANNEL_CODE("channel_code", "业务渠道编码","分销渠道"),

    SC_ITEM_GROUP_CODE("sc_item_group_code", "货品组编码","产品组"),

    CUSTOMER_SEND_ADDRESS_CODE("customer_send_address_code", "客户收货地址编码（SAP 送达方编码）","送达方"),

    SALES_UNIT_CODE("sales_unit_code", "货品单位编码（包箱件）","销售单位"),

    MATERIAL_CODE("material_code", "货品编码（ SAP物料编码）","物料"),

    CUSTOMER_SALE_ADDRESS_CODE("customer_sale_address_code", "客户编码（SAP售达方编码）","售达方"),

    SALES_AREA("sales_area", "销售地区编码（不同于销售区域）","销售地区"),

    CUSTOMER_GROUP("customer_group", "客户组编码","客户组"),

    FACTORY_CODE("factory_code", "工厂编码（传逻辑仓库中的工厂编码）","工厂"),

    PRICE_LIST_CODE("price_list_code", "价目清单编码","价目清单"),




    SALES_DEPARTMENT("sales_department_code","销售部","销售部"),

    SALES_GROUP("sales_group_code","销售组","销售组"),

    STORE_PLACE("store_place","存储位置","存储位置"),

    DEPARTMENT("department_code","部门（价格映射表中货品组的含义）","部门"),

    PRICE_AREA("price_area","定价区域","定价区域"),

    CUSTOM_CODE("customer_code","客户编码","客户");

    /**
     * 关键词
     */
    private String key;


    /**
     * 意思
     */
    private String mean;

    /**
     * 维度属性描述
     */
    private String dimensionPropertyDesc;

    DimensionPropertyEnum(java.lang.String key, java.lang.String mean, String dimensionPropertyDesc) {
        this.key = key;
        this.mean = mean;
        this.dimensionPropertyDesc = dimensionPropertyDesc;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getMean() {
        return mean;
    }

    public void setMean(String mean) {
        this.mean = mean;
    }


    /**
     * 获取维度属性描述
     * @return
     */
    public String getDimensionPropertyDesc() {
        return dimensionPropertyDesc;
    }


    /**
     * 获取 key
     * @param dimensionPropertyDesc 维度属性描述
     * @return
     */
    public static String obtainKey(String dimensionPropertyDesc){
        return Arrays.stream(DimensionPropertyEnum.values())
                .filter(e->e.getDimensionPropertyDesc().equals(dimensionPropertyDesc))
                .findFirst().get().getKey();
    }


}
